package cool.lichuan.project.system.controller;

import cool.lichuan.common.domain.Result;
import cool.lichuan.project.system.dto.LoginDto;
import cool.lichuan.project.system.service.impl.LoginService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

/**
 * @author lichuan
 * @date 2021/11/24 15:25
 * @description
 */
@RestController
@RequiredArgsConstructor
public class LoginController {
    private final LoginService loginService;

    @PostMapping("/login")
    public Result<Object> login(@Valid LoginDto loginDto, HttpServletRequest request) {
        loginService.login(loginDto, request);
        return Result.success();
    }
}
